//
//  DCFeatureItemCell.m
//  CDDStoreDemo
//
//  Created by apple on 2017/7/13.
//  Copyright © 2017年 RocketsChen. All rights reserved.
//

#import "SCFeatureItemCell.h"

@interface SCFeatureItemCell ()

/* 属性 */
@property (strong , nonatomic)UILabel *attLabel;

@end

@implementation SCFeatureItemCell

#pragma mark - Intial
- (instancetype)initWithFrame:(CGRect)frame {
    
    self = [super initWithFrame:frame];
    if (self) {
        
        self.backgroundColor = BGColor;
        ViewRadius(self, 3);
        [self setUpUI];
    }
    return self;
}
- (void)setUpUI{
    self.attLabel = [UILabel new];
    self.attLabel.textAlignment = NSTextAlignmentCenter;
    self.attLabel.font = SCFont(13);
    self.attLabel.textColor = RGB(51, 51, 51);
    self.attLabel.text = @"规格1";
    [self addSubview:self.attLabel];
    
    [self.attLabel mas_makeConstraints:^(MASConstraintMaker *make){
        make.top.left.bottom.right.equalTo(self.contentView).offset(0);
    }];
}
- (void)setModel:(SCModel *)model{
    _model = model;
    self.attLabel.text = model.attr_value;

    if ([model.is_default intValue] == 0) {
        self.attLabel.textColor = RGB(51, 51, 51);
        self.backgroundColor = BGColor;
    }else{
        self.attLabel.textColor = [UIColor whiteColor];
        self.backgroundColor = RGB(255, 29, 48);
    }
}

- (void)layoutSubviews{
    [super layoutSubviews];
}

@end
